#include <stdio.h>

int visit(int* a, int* b) {
    if (b[0] < 0) return 0;
    else return a[b[0]] + visit(a + b[0] + 1, b + 1);
}

#define n 15
int main(){
    int nums[]={0x27,0x29,0x30,0x31,0x7,0x5,0x3d,0x22,0xc,0x2a,0xd,0x16,0x3,0x4,0x2c};
    int ins[n]={1,1,-1}; // 数组 ins

    // 目标值
    int target = 0x5a;
    // 打印数组 ins
    printf("数组 ins: ");
    for (int i = 0; i < n; i++) {
        printf("%02x ", ins[i]);
    }
    printf("\n");

    // 调用 visit 函数
    int result = visit(nums, ins);
    printf("visit(nums, ins) 的返回值: %02x\n", result);

    return 0;

}